<!DOCTYPE html>
<html>
    <head>
        <title>demo</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <style>
            body {
                font-family: Monospace;
                background-color: #f0f0f0;
                margin: 0px;
                overflow: hidden;
            }
        </style>
    </head>
    <body>
        <script src="https://cdn.bootcdn.net/ajax/libs/three.js/73/three.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/tween.js/0.11.0/Tween.min.js"></script>
		<script src="https://unpkg.com/three@0.73.1/examples/js/controls/TrackballControls.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/stats.js/10/Stats.min.js"></script>
        <script>

            var jsonstr = '[{"boxId":"942617001023408","x":-75.900002,"y":-97.750000,"z":-536.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":179.000000,"platform":"platform09","order":1,"material":"","type":1,"place":100},{"boxId":"942617001022993","x":-75.900002,"y":-33.250000,"z":-536.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":179.000000,"platform":"platform09","order":2,"material":"","type":1,"place":100},{"boxId":"942617001022988","x":-75.900002,"y":31.250000,"z":-536.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":179.000000,"platform":"platform09","order":3,"material":"","type":1,"place":100},{"boxId":"942617001022995","x":-75.900002,"y":95.750000,"z":-536.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":178.500000,"platform":"platform09","order":4,"material":"","type":1,"place":100},{"boxId":"942617001022994","x":4.100000,"y":-97.750000,"z":-536.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":178.500000,"platform":"platform09","order":5,"material":"","type":1,"place":100},{"boxId":"942617001022986","x":4.100000,"y":-33.250000,"z":-536.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":178.500000,"platform":"platform09","order":6,"material":"","type":1,"place":100},{"boxId":"942617001022996","x":4.100000,"y":31.250000,"z":-536.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":178.000000,"platform":"platform09","order":7,"material":"","type":1,"place":100},{"boxId":"942617001022991","x":4.100000,"y":95.750000,"z":-536.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":178.000000,"platform":"platform09","order":8,"material":"","type":1,"place":100},{"boxId":"942617001022967","x":72.099998,"y":-93.500000,"z":-559.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":169.199997,"platform":"platform09","order":9,"material":"","type":1,"place":100},{"boxId":"942617001022970","x":72.099998,"y":-20.500000,"z":-559.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":168.800003,"platform":"platform09","order":10,"material":"","type":1,"place":100},{"boxId":"942617001022959","x":72.099998,"y":52.500000,"z":-559.500000,"width":56.000000,"height":73.000000,"length":73.000000,"weight":161.500000,"platform":"platform09","order":11,"material":"","type":1,"place":100},{"boxId":"942617001022990","x":-75.900002,"y":-97.750000,"z":-416.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":178.000000,"platform":"platform09","order":12,"material":"","type":1,"place":100},{"boxId":"942617001022987","x":-75.900002,"y":-33.250000,"z":-416.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":178.000000,"platform":"platform09","order":13,"material":"","type":1,"place":100},{"boxId":"942617001022992","x":-75.900002,"y":31.250000,"z":-416.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":177.500000,"platform":"platform09","order":14,"material":"","type":1,"place":100},{"boxId":"942617001022989","x":-75.900002,"y":95.750000,"z":-416.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":177.000000,"platform":"platform09","order":15,"material":"","type":1,"place":100},{"boxId":"942617001022985","x":4.100000,"y":-97.750000,"z":-416.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":156.000000,"platform":"platform09","order":16,"material":"","type":1,"place":100},{"boxId":"942617001023464","x":4.100000,"y":-33.250000,"z":-416.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":130.500000,"platform":"platform09","order":17,"material":"","type":1,"place":100},{"boxId":"94261700101Z443","x":4.100000,"y":31.250000,"z":-416.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":112.000000,"platform":"platform09","order":18,"material":"","type":1,"place":100},{"boxId":"942617001023134","x":4.100000,"y":95.750000,"z":-416.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":106.000000,"platform":"platform09","order":19,"material":"","type":1,"place":100},{"boxId":"942617001022974","x":69.099998,"y":-96.000000,"z":-442.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":236.199997,"platform":"platform09","order":20,"material":"","type":1,"place":100},{"boxId":"942617001023022","x":69.099998,"y":-28.000000,"z":-442.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":236.000000,"platform":"platform09","order":21,"material":"","type":1,"place":100},{"boxId":"942617001023021","x":69.099998,"y":40.000000,"z":-442.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":235.699997,"platform":"platform09","order":22,"material":"","type":1,"place":100},{"boxId":"942617001023018","x":78.099998,"y":-96.000000,"z":-383.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":235.550003,"platform":"platform09","order":23,"material":"","type":1,"place":200},{"boxId":"942617001022973","x":78.099998,"y":-28.000000,"z":-383.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":235.000000,"platform":"platform09","order":24,"material":"","type":1,"place":200},{"boxId":"942617001022976","x":78.099998,"y":40.000000,"z":-383.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":234.500000,"platform":"platform09","order":25,"material":"","type":1,"place":200},{"boxId":"942617001023570","x":-75.900002,"y":-97.750000,"z":-296.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":94.500000,"platform":"platform09","order":26,"material":"","type":1,"place":100},{"boxId":"942617001023406","x":-75.900002,"y":-33.250000,"z":-296.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":91.500000,"platform":"platform09","order":27,"material":"","type":1,"place":100},{"boxId":"942617001023001","x":-75.900002,"y":31.250000,"z":-296.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":59.500000,"platform":"platform09","order":28,"material":"","type":1,"place":100},{"boxId":"942617001023000","x":-75.900002,"y":95.750000,"z":-296.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":55.000000,"platform":"platform09","order":29,"material":"","type":1,"place":100},{"boxId":"942617001023517","x":4.100000,"y":-99.550003,"z":-296.000000,"width":80.000000,"height":60.900002,"length":120.000000,"weight":90.500000,"platform":"platform09","order":30,"material":"","type":1,"place":100},{"boxId":"94261700101T567","x":4.100000,"y":-43.700001,"z":-296.000000,"width":80.000000,"height":50.799999,"length":120.000000,"weight":71.000000,"platform":"platform09","order":31,"material":"","type":1,"place":100},{"boxId":"942617001021259","x":4.100000,"y":6.900000,"z":-296.000000,"width":80.000000,"height":50.400002,"length":120.000000,"weight":71.000000,"platform":"platform09","order":32,"material":"","type":1,"place":100},{"boxId":"94261700101T911","x":4.100000,"y":57.150002,"z":-296.000000,"width":80.000000,"height":50.099998,"length":120.000000,"weight":77.500000,"platform":"platform09","order":33,"material":"","type":1,"place":100},{"boxId":"942617001021345","x":4.100000,"y":105.949997,"z":-296.000000,"width":80.000000,"height":47.500000,"length":120.000000,"weight":58.500000,"platform":"platform09","order":34,"material":"","type":1,"place":100},{"boxId":"942617001022975","x":69.099998,"y":-96.000000,"z":-322.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":234.300003,"platform":"platform09","order":35,"material":"","type":1,"place":100},{"boxId":"942617001023020","x":69.099998,"y":-28.000000,"z":-322.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":234.100006,"platform":"platform09","order":36,"material":"","type":1,"place":100},{"boxId":"942617001023303","x":69.099998,"y":40.000000,"z":-322.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":233.750000,"platform":"platform09","order":37,"material":"","type":1,"place":100},{"boxId":"942617001023305","x":78.099998,"y":-96.000000,"z":-263.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":231.649994,"platform":"platform09","order":38,"material":"","type":1,"place":200},{"boxId":"942617001023304","x":78.099998,"y":-28.000000,"z":-263.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":231.199997,"platform":"platform09","order":39,"material":"","type":1,"place":200},{"boxId":"942617001023302","x":78.099998,"y":40.000000,"z":-263.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":230.500000,"platform":"platform09","order":40,"material":"","type":1,"place":200},{"boxId":"94261700101U010","x":-75.900002,"y":-105.650002,"z":-176.000000,"width":80.000000,"height":48.700001,"length":120.000000,"weight":73.500000,"platform":"platform09","order":41,"material":"","type":1,"place":100},{"boxId":"942617001022852","x":-75.900002,"y":-56.950001,"z":-176.000000,"width":80.000000,"height":48.700001,"length":120.000000,"weight":64.000000,"platform":"platform09","order":42,"material":"","type":1,"place":100},{"boxId":"94261700101T906","x":-75.900002,"y":-8.250000,"z":-176.000000,"width":80.000000,"height":48.700001,"length":120.000000,"weight":53.500000,"platform":"platform09","order":43,"material":"","type":1,"place":100},{"boxId":"942617001023513","x":-77.400002,"y":60.700001,"z":-197.500000,"width":77.000000,"height":89.199997,"length":77.000000,"weight":82.500000,"platform":"platform09","order":44,"material":"","type":1,"place":100},{"boxId":"942617001023141","x":2.600000,"y":-86.099998,"z":-197.500000,"width":77.000000,"height":87.800003,"length":77.000000,"weight":78.000000,"platform":"platform09","order":45,"material":"","type":1,"place":100},{"boxId":"942617001023380","x":2.600000,"y":-0.100000,"z":-197.500000,"width":77.000000,"height":84.199997,"length":77.000000,"weight":68.500000,"platform":"platform09","order":46,"material":"","type":1,"place":100},{"boxId":"942617001023138","x":2.600000,"y":83.400002,"z":-197.500000,"width":77.000000,"height":82.800003,"length":77.000000,"weight":77.000000,"platform":"platform09","order":47,"material":"","type":1,"place":100},{"boxId":"942617001023306","x":66.099998,"y":-96.000000,"z":-202.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":229.750000,"platform":"platform09","order":48,"material":"","type":1,"place":100},{"boxId":"942617001023019","x":66.099998,"y":-28.000000,"z":-202.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":229.199997,"platform":"platform09","order":49,"material":"","type":1,"place":100},{"boxId":"942617001023307","x":66.099998,"y":40.000000,"z":-202.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":228.800003,"platform":"platform09","order":50,"material":"","type":1,"place":100},{"boxId":"942617001023308","x":75.099998,"y":-96.000000,"z":-143.000000,"width":50.000000,"height":68.000000,"length":68.000000,"weight":228.649994,"platform":"platform09","order":51,"material":"","type":1,"place":200},{"boxId":"942617001023311","x":-76.650002,"y":35.349998,"z":-138.750000,"width":40.500000,"height":38.500000,"length":78.500000,"weight":22.000000,"platform":"platform09","order":52,"material":"","type":1,"place":200},{"boxId":"942617001023187","x":-76.650002,"y":73.849998,"z":-138.750000,"width":40.500000,"height":38.500000,"length":78.500000,"weight":18.500000,"platform":"platform09","order":53,"material":"","type":1,"place":200},{"boxId":"942617001021355","x":-77.400002,"y":-88.599998,"z":-77.500000,"width":77.000000,"height":82.800003,"length":77.000000,"weight":76.000000,"platform":"platform09","order":54,"material":"","type":1,"place":100},{"boxId":"942617001023493","x":-77.400002,"y":-5.800000,"z":-77.500000,"width":77.000000,"height":82.800003,"length":77.000000,"weight":71.500000,"platform":"platform09","order":55,"material":"","type":1,"place":100},{"boxId":"942617001023485","x":-77.400002,"y":77.000000,"z":-77.500000,"width":77.000000,"height":82.800003,"length":77.000000,"weight":67.500000,"platform":"platform09","order":56,"material":"","type":1,"place":100},{"boxId":"942617001023154","x":-0.400000,"y":-88.599998,"z":-77.500000,"width":77.000000,"height":82.800003,"length":77.000000,"weight":57.000000,"platform":"platform09","order":57,"material":"","type":1,"place":100},{"boxId":"942617001023150","x":-0.400000,"y":-7.900000,"z":-77.500000,"width":77.000000,"height":78.599998,"length":77.000000,"weight":234.000000,"platform":"platform09","order":58,"material":"","type":1,"place":100},{"boxId":"942617001023224","x":-0.400000,"y":62.450001,"z":-77.500000,"width":77.000000,"height":62.099998,"length":77.000000,"weight":140.000000,"platform":"platform09","order":59,"material":"","type":1,"place":100},{"boxId":"94261700101T615","x":76.599998,"y":-101.800003,"z":-77.500000,"width":77.000000,"height":56.400002,"length":77.000000,"weight":149.000000,"platform":"platform09","order":60,"material":"","type":1,"place":100},{"boxId":"942617001023512","x":76.599998,"y":-46.599998,"z":-77.500000,"width":77.000000,"height":54.000000,"length":77.000000,"weight":107.000000,"platform":"platform09","order":61,"material":"","type":1,"place":100},{"boxId":"942617001023208","x":76.599998,"y":7.400000,"z":-77.500000,"width":77.000000,"height":54.000000,"length":77.000000,"weight":102.000000,"platform":"platform09","order":62,"material":"","type":1,"place":100},{"boxId":"942617001023066","x":76.599998,"y":61.400002,"z":-77.500000,"width":77.000000,"height":54.000000,"length":77.000000,"weight":101.500000,"platform":"platform09","order":63,"material":"","type":1,"place":100},{"boxId":"942617001022838","x":-77.400002,"y":-105.900002,"z":-0.500000,"width":77.000000,"height":48.200001,"length":77.000000,"weight":48.000000,"platform":"platform09","order":64,"material":"","type":1,"place":100},{"boxId":"94261700101T998","x":-77.400002,"y":-57.799999,"z":-0.500000,"width":77.000000,"height":48.000000,"length":77.000000,"weight":36.500000,"platform":"platform09","order":65,"material":"","type":1,"place":100},{"boxId":"94261700101T594","x":-77.400002,"y":-9.800000,"z":-0.500000,"width":77.000000,"height":48.000000,"length":77.000000,"weight":30.500000,"platform":"platform09","order":66,"material":"","type":1,"place":100},{"boxId":"942617001023069","x":-77.400002,"y":37.950001,"z":-0.500000,"width":77.000000,"height":47.500000,"length":77.000000,"weight":44.000000,"platform":"platform09","order":67,"material":"","type":1,"place":100},{"boxId":"94261700101U009","x":-77.400002,"y":85.349998,"z":-0.500000,"width":77.000000,"height":47.299999,"length":77.000000,"weight":43.500000,"platform":"platform09","order":68,"material":"","type":1,"place":100},{"boxId":"942617001023058","x":1.850000,"y":-105.250000,"z":-18.250000,"width":41.500000,"height":49.500000,"length":81.500000,"weight":60.500000,"platform":"platform09","order":69,"material":"","type":1,"place":200},{"boxId":"942617001023140","x":1.850000,"y":-55.750000,"z":-18.250000,"width":41.500000,"height":49.500000,"length":81.500000,"weight":50.500000,"platform":"platform09","order":70,"material":"","type":1,"place":200},{"boxId":"942617001023156","x":0.350000,"y":-11.750000,"z":-18.750000,"width":40.500000,"height":38.500000,"length":78.500000,"weight":14.500000,"platform":"platform09","order":71,"material":"","type":1,"place":200},{"boxId":"942617001023279","x":0.350000,"y":26.750000,"z":-18.750000,"width":40.500000,"height":38.500000,"length":78.500000,"weight":14.000000,"platform":"platform09","order":72,"material":"","type":1,"place":200},{"boxId":"942617001021357","x":0.200000,"y":73.500000,"z":-18.900000,"width":40.200001,"height":55.000000,"length":78.199997,"weight":32.500000,"platform":"platform09","order":73,"material":"","type":1,"place":200},{"boxId":"942617001023502","x":-95.800003,"y":-102.500000,"z":77.099998,"width":40.200001,"height":55.000000,"length":78.199997,"weight":30.500000,"platform":"platform09","order":74,"material":"","type":1,"place":100},{"boxId":"942617001023246","x":-95.800003,"y":-47.500000,"z":77.099998,"width":40.200001,"height":55.000000,"length":78.199997,"weight":27.000000,"platform":"platform09","order":75,"material":"","type":1,"place":100},{"boxId":"94261700101Z444","x":-95.800003,"y":7.500000,"z":77.099998,"width":40.200001,"height":55.000000,"length":78.199997,"weight":26.500000,"platform":"platform09","order":76,"material":"","type":1,"place":100},{"boxId":"942617001023497","x":-95.800003,"y":62.500000,"z":77.099998,"width":40.200001,"height":55.000000,"length":78.199997,"weight":26.000000,"platform":"platform09","order":77,"material":"","type":1,"place":100},{"boxId":"942617001021243","x":-55.599998,"y":-102.500000,"z":77.099998,"width":40.200001,"height":55.000000,"length":78.199997,"weight":23.500000,"platform":"platform09","order":78,"material":"","type":1,"place":100},{"boxId":"942617001023491","x":-55.599998,"y":-47.500000,"z":77.099998,"width":40.200001,"height":55.000000,"length":78.199997,"weight":23.000000,"platform":"platform09","order":79,"material":"","type":1,"place":100},{"boxId":"942617001023438","x":-55.599998,"y":7.500000,"z":77.099998,"width":40.200001,"height":55.000000,"length":78.199997,"weight":23.000000,"platform":"platform09","order":80,"material":"","type":1,"place":100},{"boxId":"942617001023145","x":-55.599998,"y":62.500000,"z":77.099998,"width":40.200001,"height":55.000000,"length":78.199997,"weight":21.000000,"platform":"platform09","order":81,"material":"","type":1,"place":100},{"boxId":"942617001023414","x":-15.400000,"y":-102.500000,"z":77.099998,"width":40.200001,"height":55.000000,"length":78.199997,"weight":15.000000,"platform":"platform09","order":82,"material":"","type":1,"place":100},{"boxId":"942617001023484","x":-15.400000,"y":-47.500000,"z":77.099998,"width":40.200001,"height":55.000000,"length":78.199997,"weight":11.500000,"platform":"platform09","order":83,"material":"","type":1,"place":100},{"boxId":"9426C008T055171","x":69.599998,"y":97.000000,"z":-567.500000,"width":51.000000,"height":16.000000,"length":57.000000,"weight":7.590000,"platform":"platform37","order":84,"material":"","type":1,"place":100},{"boxId":"9426C008T055173","x":63.349998,"y":113.500000,"z":-568.000000,"width":38.500000,"height":17.000000,"length":56.000000,"weight":3.910000,"platform":"platform37","order":85,"material":"","type":1,"place":100},{"boxId":"9426C008T055165","x":-87.650002,"y":117.500000,"z":-1.500000,"width":56.500000,"height":17.000000,"length":75.000000,"weight":11.150000,"platform":"platform37","order":86,"material":"","type":1,"place":100},{"boxId":"9426C008T055164","x":70.849998,"y":-121.500000,"z":-1.500000,"width":56.500000,"height":17.000000,"length":75.000000,"weight":11.150000,"platform":"platform37","order":87,"material":"","type":1,"place":100},{"boxId":"9426C008T055163","x":70.849998,"y":-104.500000,"z":-1.500000,"width":56.500000,"height":17.000000,"length":75.000000,"weight":11.120000,"platform":"platform37","order":88,"material":"","type":1,"place":100},{"boxId":"9426C008T055166","x":70.849998,"y":-87.500000,"z":-1.500000,"width":56.500000,"height":17.000000,"length":75.000000,"weight":11.100000,"platform":"platform37","order":89,"material":"","type":1,"place":100},{"boxId":"9426C008T055162","x":70.849998,"y":-70.500000,"z":-1.500000,"width":56.500000,"height":17.000000,"length":75.000000,"weight":9.590000,"platform":"platform37","order":90,"material":"","type":1,"place":100},{"boxId":"9426C008T055167","x":70.849998,"y":-53.500000,"z":-1.500000,"width":56.500000,"height":17.000000,"length":75.000000,"weight":9.580000,"platform":"platform37","order":91,"material":"","type":1,"place":100},{"boxId":"9426C008T055168","x":70.849998,"y":-36.500000,"z":-1.500000,"width":56.500000,"height":17.000000,"length":75.000000,"weight":6.920000,"platform":"platform37","order":92,"material":"","type":1,"place":100},{"boxId":"9426C008T055172","x":64.099998,"y":-19.500000,"z":-5.500000,"width":43.000000,"height":17.000000,"length":67.000000,"weight":4.750000,"platform":"platform37","order":93,"material":"","type":1,"place":100},{"boxId":"9426C008T055170","x":64.099998,"y":-2.500000,"z":-5.500000,"width":43.000000,"height":17.000000,"length":67.000000,"weight":4.140000,"platform":"platform37","order":94,"material":"","type":1,"place":100},{"boxId":"9426C008T055169","x":62.099998,"y":31.250000,"z":-9.500000,"width":39.000000,"height":50.500000,"length":59.000000,"weight":16.910000,"platform":"platform37","order":95,"material":"","type":1,"place":100},{"boxId":"9426C008T053854","x":62.099998,"y":81.750000,"z":-9.500000,"width":39.000000,"height":50.500000,"length":59.000000,"weight":16.770000,"platform":"platform37","order":96,"material":"","type":1,"place":100},{"boxId":"9426C008T055175","x":50.700001,"y":-100.750000,"z":71.000000,"width":66.000000,"height":58.500000,"length":92.000000,"weight":75.199997,"platform":"platform37","order":97,"material":"","type":1,"place":200},{"boxId":"9426C008T055174","x":50.700001,"y":-42.250000,"z":71.000000,"width":66.000000,"height":58.500000,"length":92.000000,"weight":75.000000,"platform":"platform37","order":98,"material":"","type":1,"place":200},{"boxId":"9426C008T053852","x":42.950001,"y":-3.500000,"z":59.000000,"width":42.000000,"height":19.000000,"length":76.500000,"weight":20.280001,"platform":"platform37","order":99,"material":"","type":1,"place":200},{"boxId":"9426C008T053851","x":-75.650002,"y":-87.500000,"z":176.199997,"width":80.500000,"height":85.000000,"length":120.000000,"weight":128.399994,"platform":"platform37","order":100,"material":"","type":1,"place":100},{"boxId":"9426C008T053849","x":-75.650002,"y":-2.500000,"z":176.199997,"width":80.500000,"height":85.000000,"length":120.000000,"weight":104.800003,"platform":"platform37","order":101,"material":"","type":1,"place":100},{"boxId":"9426C008T055160","x":-75.650002,"y":82.500000,"z":176.199997,"width":80.500000,"height":85.000000,"length":120.000000,"weight":100.000000,"platform":"platform37","order":102,"material":"","type":1,"place":100},{"boxId":"9426C008T053850","x":4.850000,"y":-87.500000,"z":176.199997,"width":80.500000,"height":85.000000,"length":120.000000,"weight":94.400002,"platform":"platform37","order":103,"material":"","type":1,"place":100},{"boxId":"9426C008T053848","x":4.850000,"y":-2.500000,"z":176.199997,"width":80.500000,"height":85.000000,"length":120.000000,"weight":92.599998,"platform":"platform37","order":104,"material":"","type":1,"place":100},{"boxId":"9426C008T055159","x":4.850000,"y":82.500000,"z":176.199997,"width":80.500000,"height":85.000000,"length":120.000000,"weight":88.000000,"platform":"platform37","order":105,"material":"","type":1,"place":100},{"boxId":"9426C008T053853","x":67.099998,"y":-118.449997,"z":138.199997,"width":44.000000,"height":23.100000,"length":44.000000,"weight":13.290000,"platform":"platform37","order":106,"material":"","type":1,"place":100},{"boxId":"9426C008T055161","x":-75.650002,"y":-87.500000,"z":296.200012,"width":80.500000,"height":85.000000,"length":120.000000,"weight":77.800003,"platform":"platform37","order":107,"material":"","type":1,"place":100},{"boxId":"942617001024165","x":-58.900002,"y":-65.000000,"z":446.700012,"width":114.000000,"height":130.000000,"length":181.000000,"weight":372.209991,"platform":"platform18","order":108,"material":"","type":1,"place":100},{"boxId":"942617001024164","x":-58.900002,"y":65.000000,"z":446.700012,"width":114.000000,"height":130.000000,"length":181.000000,"weight":372.209991,"platform":"platform18","order":109,"material":"","type":1,"place":100},{"boxId":"942617001024163","x":55.099998,"y":-65.000000,"z":446.700012,"width":114.000000,"height":130.000000,"length":181.000000,"weight":372.209991,"platform":"platform18","order":110,"material":"","type":1,"place":100},{"boxId":"942617001024162","x":55.099998,"y":65.000000,"z":446.700012,"width":114.000000,"height":130.000000,"length":181.000000,"weight":372.209991,"platform":"platform18","order":111,"material":"","type":1,"place":100}]';
			var jsonstr2 = '{"container_length":1192.000000,"container_width":231.800003,"container_height":260.000000,"container_max_load":18000.000000,"container_type_name":"40HQ"}'
            var objectArray= JSON.parse(jsonstr);
			var truckJsonObj = JSON.parse(jsonstr2);
            var container, stats;
            var camera, controls, scene, projector, renderer;
            var objects = [], plane;
            var mouse = new THREE.Vector2(), offset = new THREE.Vector3(), INTERSECTED, SELECTED; 
            init();
            animate();
            function init() {
                container = document.createElement( 'div' );
                document.body.appendChild( container );
                camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );
                camera.position.x = -600;
                camera.position.y = 400;
                camera.position.z = 1000;
                controls = new THREE.TrackballControls( camera );
                controls.rotateSpeed = 1.0;
                controls.zoomSpeed = 1.2;
                controls.panSpeed = 0.8;
                controls.noZoom = false;
                controls.noPan = true;
                controls.staticMoving = false;
                controls.dynamicDampingFactor = 0.3;
                scene = new THREE.Scene();
                var ambientLight = new THREE.AmbientLight( Math.random() *0xffffff );
                scene.add( ambientLight );
                var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
                directionalLight.position.set( 0, 1, 0 );
                scene.add( directionalLight );
                var pointLight = new THREE.PointLight( 0xff0000, 1, 500 );
                pointLight.position.set( 0, 0, -200 );
                scene.add( pointLight );

                container_length = truckJsonObj.container_length;
                container_width = truckJsonObj.container_width;
                container_height = truckJsonObj.container_height;
                var cube_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( container_width, container_height, container_length, 1,1,1 ), 
                    new THREE.MeshBasicMaterial( { color:0xefb73e, wireframe:true } )
                );
                cube_1.position.x = 0;
                cube_1.position.y = 0;
                cube_1.position.z = 0;
                scene.add( cube_1 );

                truck_head_length = 145;
                var truck_head_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( 200, 100, truck_head_length, 1, 1, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_1.position.x = 0;
                truck_head_1.position.y = -50;
                truck_head_1.position.z = -(container_length/2 + truck_head_length/2);
                scene.add( truck_head_1 );
                
                truck_head_length_2 = 80;
                var truck_head_2 = new THREE.Mesh(
                    new THREE.BoxGeometry( 170, 60, truck_head_length_2, 1, 0, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_2.position.x = 0;
                truck_head_2.position.y = 30;
                truck_head_2.position.z = -(container_length/2 + truck_head_length_2/2);
                scene.add( truck_head_2 );
                
                truck_head_chimney_radius = 7;
                var truck_head_chimney1 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney1.position.x = 100;
                truck_head_chimney1.position.y = 50;
                truck_head_chimney1.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney1 );
                
                var truck_head_chimney2 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney2.position.x = -100;
                truck_head_chimney2.position.y = 50;
                truck_head_chimney2.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney2 );
        
                var truck_wheel_1 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_1.position.x = 110;
                truck_wheel_1.position.y = -100;
                truck_wheel_1.position.z = -(container_length/2 + truck_head_length_2/2 + 20) ;
                truck_wheel_1.rotation.x = 0;
                truck_wheel_1.rotation.y = 0;
                truck_wheel_1.rotation.z = 1.6;
                scene.add( truck_wheel_1 );
                
                var truck_wheel_2 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_2.position.x = -110;
                truck_wheel_2.position.y = -100;
                truck_wheel_2.position.z = -(container_length/2 + truck_head_length_2/2 + 20);
                truck_wheel_2.rotation.x = 0;
                truck_wheel_2.rotation.y = 0;
                truck_wheel_2.rotation.z = 1.6;
                scene.add( truck_wheel_2 );

                offset_2 = -240;
                var truck_wheel_5 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_5.position.x = container_width/2 + 5;
                truck_wheel_5.position.y = -100;
                truck_wheel_5.position.z = (container_length/2 + truck_head_length_2/2 + offset_2) ;
                truck_wheel_5.rotation.x = 0;
                truck_wheel_5.rotation.y = 0;
                truck_wheel_5.rotation.z = 1.6;
                scene.add( truck_wheel_5 );

                var truck_wheel_6 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_6.position.x = -container_width/2 - 5;
                truck_wheel_6.position.y = -100;
                truck_wheel_6.position.z = (container_length/2 + truck_head_length_2/2 + offset_2);
                truck_wheel_6.rotation.x = 0;
                truck_wheel_6.rotation.y = 0;
                truck_wheel_6.rotation.z = 1.6;
                scene.add( truck_wheel_6 );

                for (var i in objectArray) {
                    if (objectArray[i].type==2) {
						var cylinderTopR = objectArray[i].length / 2;
						var cylinderHeight = objectArray[i].height;
						if (objectArray[i].place == 1 || objectArray[i].place == 2)
						{
							cylinderHeight = objectArray[i].width;
						}
						
                        var object2 = new THREE.Mesh(
						    new THREE.CylinderGeometry(cylinderTopR, cylinderTopR, cylinderHeight, 60),
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object2.position.x = objectArray[i].x;
                        object2.position.y = objectArray[i].y;
                        object2.position.z = objectArray[i].z;
                        if (objectArray[i].place==1) {
                            object2.rotation.z = 55;
                        }
                        if (objectArray[i].place==2) {
                            object2.rotation.x = 55;
                        }
                        object2.width = objectArray[i].width;
                        object2.height = objectArray[i].height;
                        object2.length = objectArray[i].length;
                        object2.weight = objectArray[i].weight;
                        object2.platform = objectArray[i].platform;
                        object2.order = objectArray[i].order;
                        object2.materialInfo = objectArray[i].material;
                        object2.boxId = objectArray[i].boxId;
                        object2.type = objectArray[i].type;
                        object2.place = objectArray[i].place;
                        scene.add( object2 );
                        objects.push( object2 );
                    }
                    if (objectArray[i].type==1) {
						if (objectArray[i].place == 200)
						{
							var box_length = objectArray[i].width;
                            var box_width = objectArray[i].length;
						}
						else
						{
							var box_length = objectArray[i].length;
							var box_width = objectArray[i].width;
						}
						var box_height = objectArray[i].height;
                        var object = new THREE.Mesh(
                            new THREE.BoxGeometry( box_width, box_height, box_length, 1, 1, 1 ), 
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object.position.x = objectArray[i].x;
                        object.position.y = objectArray[i].y;
                        object.position.z = objectArray[i].z;
						object.length = objectArray[i].length;
						object.width = objectArray[i].width;
						object.height = objectArray[i].height;
                        object.weight = objectArray[i].weight;
                        object.platform = objectArray[i].platform;
                        object.order = objectArray[i].order;
                        object.materialInfo = objectArray[i].material;
                        object.boxId = objectArray[i].boxId;
                        object.type = objectArray[i].type;
                        object.place = objectArray[i].place;
                        scene.add( object );
                        objects.push( object );
                    }
                }

                plane = new THREE.Mesh(
                    new THREE.PlaneGeometry( 2000, 2000, 8, 8 ),
                    new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.25, transparent: true, wireframe: true } )
                );
                plane.visible = true;
                scene.add( plane );
                projector = new THREE.Projector();
                renderer = new THREE.WebGLRenderer( { antialias: true } );
                renderer.sortObjects = false;
                renderer.setSize( window.innerWidth, window.innerHeight );
                renderer.shadowMapEnabled = true;
                renderer.shadowMapType = THREE.PCFShadowMap;
                container.appendChild( renderer.domElement );

                stats = new Stats();
                stats.domElement.style.position = 'absolute';
                stats.domElement.style.top = '0px';
                container.appendChild( stats.domElement );

                window.addEventListener( 'resize', onWindowResize, false );
                renderer.domElement.addEventListener( 'mousemove', onDocumentMouseMove, false );
                renderer.domElement.addEventListener( 'mousedown', onDocumentMouseDown, false );
                renderer.domElement.addEventListener( 'mouseup', onDocumentMouseUp, false );
            }

            function onDocumentMouseMove( event ) {
                event.preventDefault();
                mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
                mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    if ( INTERSECTED != intersects[ 0 ].object ) {
                        INTERSECTED = intersects[ 0 ].object;
                        plane.position.copy( INTERSECTED.position );
                        plane.lookAt( camera.position );
                    }
                    container.style.cursor = 'pointer';
                } else {
                    container.style.cursor = 'auto';
                }
            }

            function onDocumentMouseDown( event ) {
                event.preventDefault();
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    controls.enabled = false;  
                    SELECTED = intersects[ 0 ].object;
                    var info = '<B>' + 
                        'boxId: ' + SELECTED.boxId +
                        '</br> x: ' + SELECTED.position.x + 
                        '</br> y: ' + SELECTED.position.y + 
                        '</br> z: ' + SELECTED.position.z + 
                        '</br> width: ' + SELECTED.width + 
                        '</br> height: ' + SELECTED.height + 
                        '</br> length: ' + SELECTED.length + 
                        '</br> weight: ' + SELECTED.weight +
                        '</br> platform: ' + SELECTED.platform +
                        '</br> order: ' + SELECTED.order +
                        '</br> material: ' + SELECTED.materialInfo + 
                        '</br> type: ' + SELECTED.type + 
                        '</br> place: ' + SELECTED.place + 
                        '</B>' +
                        '</br>' + 
                        '--------------------------' + 
                        '</br>' +
                        'type(1:箱体 2:圆柱体)' +
                        '</br>' +
                        'place(1:品字型 2:田字型)';
                    $("#objectInfo").html(info);
                }
            }

            function onDocumentMouseUp( event ) {
                event.preventDefault();
                controls.enabled = true;
                if ( INTERSECTED ) {
                    plane.position.copy( INTERSECTED.position );
                    SELECTED = null;
                }
                container.style.cursor = 'auto';
            }

            function onWindowResize() {
                camera.aspect = window.innerWidth / window.innerHeight;
                camera.updateProjectionMatrix();
                renderer.setSize( window.innerWidth, window.innerHeight );
            }

            function animate() {
                requestAnimationFrame( animate );
                render();
                stats.update();
            }

            function render() {
                controls.update();
                renderer.render( scene, camera );
            }

        </script>
        <div id="objectInfo" class="a2"><br/>点击物体获取相关属性</div>
        <style>
            .a2{position:absolute; left:20px; top:50px; bottom:0px; width:180px; height:250px; z-index:9999; background: #00FFFF; font-weight:bold; }
        </style>
    </body>
</html>